MetaFetcheR is an R package designed to link metabolites IDs from different Metabolome databases with eachother in a step to resolve ambiguity and standardize metabolites representation and annotation. Currently the package supports resolving IDs for the following databases:
install.packages("devtools")
library(devtools) devtools::load_all() install_github("komorowskilab/metafetcher")
Uncompress all downloaded files in a directory you create and name it tmp
Create a new R project and install MetafetcheR package
library(devtools) devtools::load_all() install_github("komorowskilab/metafetcher") library(metafetcher)
write_config(host,port,db_name,user,password,path_of_tmp_folder)
8.call function install_database() for creating the tables and inserting the data from the tmp folder preferably put it in your R project directory
install_database()
Create a csv file with input IDs in the following format
library(knitr) discovery=read.csv("discovery.csv") kable(discovery,caption="example input table")
library(metafetcher) df.res <- read.csv("discovery.csv", stringsAsFactors=FALSE) resp <- resolve_metabolites(df.res) print(resp$df)
df.out <- resp$df kable(df.out ,caption="output table")
To map only a single ID you can use function resolve_single_id
library(metafetcher) resp1 <- resolve_single_id('hmdb_id', 'HMDB0001005') df.out1 <- resp1$df print(df.out1)
kable(df.out1 ,caption="output table")
https://github.com/komorowskilab/metafetcher
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.